package com.earthchen.exception;


import com.earthchen.domain.enums.ResultEnum;

/**
 * 异常基类
 *
 * @author earthchen
 * @date 2018/8/31
 **/
public class BaseException extends RuntimeException {

    private Integer code;

    public Integer getCode() {
        return code;
    }


    public BaseException() {
    }

    public BaseException(Throwable ex) {
        super(ex);
    }

    public BaseException(String message) {
        super(message);
    }

    public BaseException(String message, Throwable ex) {
        super(message, ex);
    }

    public BaseException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }

    public BaseException(Integer code, String message) {
        super(message);
        this.code = code;
    }


}
